package file;

import java.io.File;
import java.io.IOException;

/** 删除文件或目录 */
public class DeleteFileDemo {
    public static void main(String[] args) throws IOException {
        for (int i = 0; i < 5; i++) {
            File file = new File("./test"+i+".txt");
            if (!file.exists()){
                file.createNewFile();
            }if(file.exists()){
                file.delete();
            }
        }
        System.out.println("完成");
    }
}
